home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / hsrc_117.zip / EDITTEXT.C < prev    next >
Text File  |  1990-10-22  |  1KB  |  63 lines

  1. #include "msgg.h"
  2. #include "twindow.h"
  3. #include "keys.h"
  4. #include "headedit.h"
  5.  
  6.  
  7. /* Edit text (creates new msg, deletes old */
  8.  
  9. void pascal edit_text (void) {
  10.  
  11.     char tempchar;
  12.     char tempctla;
  13.     word tempnomess;
  14.     word tempmessno;
  15.     char olddate[20];
  16.     char wasdeleted=0;
  17.     char temp[81];
  18.  
  19.     tempctla=ctla;
  20.     ctla=1;
  21.     tempnomess=nomess;
  22.     tempmessno=messno;
  23.     strcpy(olddate,msg.date);
  24.  
  25.     strcpy(temp,"MSGTMP");
  26.     get_rid();
  27.     if(msg.m_attr & MSGSCANNED) {
  28.         any_message(" Message already scanned...edit anyway? (y-N) ");
  29. Loop:
  30.         tempchar=(char)toupper(get_char());
  31.         if(tempchar!='Y' && tempchar!='N' && tempchar!=13 && tempchar!=27) {
  32.             bell();
  33.             goto Loop;
  34.         }
  35.         if(tempchar!='Y') {
  36.             clear_message();
  37.             return;
  38.         }
  39.         clear_message();
  40.     }
  41.     if(edit_mess(1)==ESC) return;
  42.     if (export(temp,((currarea->attr & NET) + (currarea->attr & ALTERNATE)),EDITIT,"","",NULL)==0) goto EndIt;
  43.     if (msg.m_attr & MSGDELETED) wasdeleted=1;
  44.     msg.m_attr |= MSGDELETED;
  45.     msg.m_attr |= MSGTREATED;
  46.     put_mess();
  47.     if (!wasdeleted) msg.m_attr=msg.m_attr & (~MSGDELETED);
  48.     strcpy(msg.date,fidodate());
  49.     msg.m_attr |= MSGTREATED;
  50.     post_mess("");
  51.     nomess=check_area(areano);
  52.     if (nomess==tempnomess) {
  53.         msg.m_attr |= MSGTREATED;
  54.         messno=tempmessno;
  55.         strcpy(msg.date,olddate);
  56.         put_mess();
  57.     }
  58.  
  59. EndIt:
  60.     ctla=tempctla;
  61. }
  62.  
  63.